package com.aisino.efence.enums;

/**
 * @author fzc
 * @package com.aisino.efence.enums
 * 文件枚举
 * @create 2018-04-11 下午3:13
 **/
public enum FileEnum {

    NOT_EXIST(-1, "不存在"),
    EXIST(0, "存在"),
    ENCRYPT(1, "加密"),
    ZIP(2, "压缩"),
    UPLOAD(3, "上传"),
    MSG(4, "通知");

    private int code;

    private String message;

    FileEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    FileEnum() {
    }

    @Override
    public String toString() {
        return "FileEnum{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static FileEnum getFileEnum(int i) {
        switch (i) {
            case 0:
                return FileEnum.EXIST;
            case 1:
                return FileEnum.ENCRYPT;
            case 2:
                return FileEnum.ZIP;
            case 3:
                return FileEnum.UPLOAD;
            case 4:
                return FileEnum.MSG;
            default:
                return FileEnum.NOT_EXIST;
        }
    }
}
